<?php
/**
 * Created by PhpStorm.
 * User: softyizhi
 * Date: 2017/8/8
 * Time: 上午10:14
 */

namespace Api\Controller;

use Admin\Model\MedicalInformationsModel;
use Base\Controller\BaseApiController;

class MedicalInformationsController extends BaseApiController
{
     public function __construct()
     {
       parent::__construct(true);
     }
    protected function initModel()
    {
        $this->model = new MedicalInformationsModel();
    }
    public function getList()
    {
        $data = $this->model->select();
        $this->apiSuccess($data);
    }
    /**
     * @param $id
     * 显示资讯详情页
     */
    public function showView($id){
        if(!empty($id)){
            $data = $this->model->find($id);
            if (empty($data)){
                $this->apiError('查询失败');
            }else{
				$map['id'] = $id;
                $map['hit'] =$data['hit']+1;
                $this->model->save($map);
				$this->assign('data',$data);
                $this-> display();
            }
        }
    }

}